home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4878 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: sable.ox.ac.uk!worc0223
  2. From: worc0223@sable.ox.ac.uk (Benjamin Hutchings)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: x ^= y ^= x ^= y;
  5. Date: 6 Mar 1996 00:21:27 GMT
  6. Organization: Oxford University, England
  7. Message-ID: <4hilq7$rpg@news.ox.ac.uk>
  8. References: <1286.6624T1439T237@cs.ruu.nl> <3131C523.1ECC@sapiens.com> <4h075l$2go@elmer.tsc.com> <2141.6632T1213T2220@cs.ruu.nl>
  9. NNTP-Posting-Host: sable.ox.ac.uk
  10.  
  11. In article <2141.6632T1213T2220@cs.ruu.nl>,
  12. Wessel Dankers <wsldanke@cs.ruu.nl> wrote:
  13. >Bill Roberts <billr@elmer.tsc.com> wrote:
  14. >> In article <3131C523.1ECC@sapiens.com>, Avi Lev  <avil@sapiens.com> wrote:
  15. >>>Benjamin Hutchings wrote:
  16. >>>it'll damn right WILL work because this is proper C syntax and
  17. >>>therefore must work, if it doesn't then your compiler had better
  18. >>>be replaced for a real C compiler cuz it obviously isn't one.
  19. >Damn right! Tell'm, Ben!
  20.  
  21. You f*cking idiot! I didn't write that! Get your attribution lines right
  22. or just leave this thread and go back to your AMOS tutorials.
  23.  
  24. >
  25. >> What expression result will be in x at the end of the expression?  The
  26. >> first one or the second one?  The compiler may choose either.  The c
  27. >No it definitely CAN'T choose!
  28. >The return value of an assignment is strictly documented and an ANSI feature!
  29.  
  30. The compiler can choose to store the new values of variables in any order
  31. it wants. So when the variable is read again later in the evaluation of the
  32. expression you do _not_ know whether it will read the changed value or the
  33. original value. So the results of statements such as "x ^= y ^= x ^= y;" are
  34. undefined under ANSI. This is in the FAQ in a relevant group, I believe, since
  35. it comes up so often. KILL THIS THREAD NOW! I can't be bothered to reply to
  36. the rest of your idiotic posting.
  37.  
  38.  
  39.  
  40. -- 
  41. Ben Hutchings, student. Finger me as m95bwh@booth42.ecs.ox.ac.uk if you must.
  42. email: benjamin.hutchings@worc.ox.ac.uk  WWW: http://info.ox.ac.uk/~worc0223/
  43. My brother says: "Read Not 'alf Bad at http://info.ox.ac.uk/~worc0223/nab/".
  44.